<extend name="Public/Dialog/Common"/>
<block name="pageContent">
    <div class="bjui-pageContent">
        <form action="<literal>{:U('', I('get.'))}</literal>" class="pageForm" data-toggle="validate" method="post">
            <!-- 菜单id号 -->
            <input type="hidden" name="id" value="<literal>{:I('get.id')}</literal>">
            <table class="table table-condensed table-hover">
                <tbody>
                <tr>
                    <td colspan="2" align="center">
                        <h3>
                            添加/编辑{$tableArray['comment']?$tableArray['comment']:"操作"}
                        </h3>
                    </td>
                </tr>
                <volist name="tableInfoArray" id="tableInfo">
                    <if condition="!disposColumnSpecialMark($tableInfo[$columnCommentKey], 'edit') && $tableInfo[$columnNameKey] neq 'id'">
                    <tr>
                        <td>
                            <label class="control-label x90">{$tableInfo[$columnCommentKey]|disposColumnComment=$tableInfo[$columnNameKey]}：</label>

                            <if condition="disposColumnSpecialMark($tableInfo[$columnCommentKey], 'num', 'type')">
                            <!-- 数字类型 -->
                                <input type="text" data-rule="required" size="5" name="{$tableInfo[$columnNameKey]}" data-toggle="spinner" data-min="0" data-max="1000" data-step="1" data-rule="integer"
                                       value="<literal>{$vo.</literal>{$tableInfo[$columnCommentKey]|disposColumnFunction=$tableInfo[$columnNameKey]}}">
                            <elseif condition="disposColumnSpecialMark($tableInfo[$columnCommentKey], 'string', 'type')"/>
                                <!-- 字符串类型 -->
                                <input type="text" data-rule="required" size="20" name="{$tableInfo[$columnNameKey]}" value="<literal>{$vo.</literal>{$tableInfo[$columnCommentKey]|disposColumnFunction=$tableInfo[$columnNameKey]}}">
                            <elseif condition="disposColumnSpecialMark($tableInfo[$columnCommentKey], 'textarea', 'type')"/>
                                <!-- 文本框 -->
                                 <textarea type="text" data-rule="required" data-toggle="autoheight" cols="60" rows="1" name="{$tableInfo[$columnNameKey]}">
                                    <literal>{$vo.</literal>{$tableInfo[$columnCommentKey]|disposColumnFunction=$tableInfo[$columnNameKey]}}</textarea>
                            <elseif condition="disposColumnSpecialMark($tableInfo[$columnCommentKey], 'editor', 'type')"/>
                                <!-- 编辑器 -->
                                <textarea name="{$tableInfo[$columnNameKey]}" data-toggle="kindeditor" data-minheight="200"><literal>
                                    {$vo.</literal>{$tableInfo[$columnCommentKey]|disposColumnFunction=$tableInfo[$columnNameKey]}}</textarea>
                            <elseif condition="disposColumnSpecialMark($tableInfo[$columnCommentKey], 'date', 'type')"/>
                                <!-- 日期 -->
                                <input type="text"  data-rule="required" data-toggle="datepicker" size="20" name="{$tableInfo[$columnNameKey]}"
                                       value="<literal>{$vo.</literal>{$tableInfo[$columnCommentKey]|disposColumnFunction=$tableInfo[$columnNameKey]}}">
                            <elseif condition="disposColumnSpecialMark($tableInfo[$columnCommentKey], 'datetime', 'type')"/>
                                <!-- 时间 -->
                                <input type="text"  data-rule="required" data-toggle="datepicker" data-pattern="yyyy-MM-dd hh:mm:s" size="20" name="{$tableInfo[$columnNameKey]}"
                                       value="<literal>{$vo.</literal>{$tableInfo[$columnCommentKey]|disposColumnFunction=$tableInfo[$columnNameKey]}}"/>
                            <elseif condition="disposColumnSpecialMark($tableInfo[$columnCommentKey], 'select', 'type')"/>
                                <!-- 下拉菜单 -->
                                <select name="{$tableInfo[$columnNameKey]}" data-rule="required">
                                    <option>--请选择--</option>
                                    <!-- edit select -->
                                    <if condition="strpos($tableInfo[$columnCommentKey], 'ES|')">
                                        <literal>
                                            <volist name=":</literal>{:end(explode('|', $tableInfo[$columnCommentKey]))}<literal>" id="v"></literal>
                                            <literal>
                                                <option value="{$key}" <eq name="vo.</literal>{$tableInfo[$columnNameKey]}<literal>" value="$key">selected</eq>>{$v}</option>
                                            </literal>
                                        <literal>
                                            </volist>
                                        </literal>
                                    <else />
                                    <literal>
                                        <volist name="Think.config.</literal>{:strtoupper($tableInfo[$columnNameKey])}<literal>" id="v"></literal>
                                            <literal>
                                            <option value="{$key}" <eq name="vo.</literal>{$tableInfo[$columnNameKey]}<literal>" value="$key">selected</eq>>{$v}</option></literal>
                                            <literal>
                                        </volist>
                                    </literal>
                                    </if>
                                </select>
                            <else />
                                <input type="text" data-rule="required" size="20" name="{$tableInfo[$columnNameKey]}" value="<literal>{$vo.</literal>{$tableInfo[$columnCommentKey]|disposColumnFunction=$tableInfo[$columnNameKey]}}">
                            </if>
                        </td>
                    </tr>
                    </if>
                </volist>
                </tbody>
            </table>
        </form>
    </div>
</block>
